package com.fan.txl.pay;

import com.elvishew.xlog.XLog;
import com.fan.txl.data.pay.WxPayOrder;
import com.tencent.mm.sdk.modelpay.PayReq;
import com.tencent.mm.sdk.openapi.IWXAPI;

/**
 * Created by jiajiabao on 17-2-23.
 */

public class Pay implements PayInterface {

    @Override
    public void alipay(String body) {

    }

    @Override
    public  void wxpay(IWXAPI iwxapi,WxPayOrder wxOrder) {
        PayReq request = new PayReq();
        request.appId = wxOrder.getAppId();
        request.partnerId = wxOrder.getPartnerId();
        request.prepayId= wxOrder.getPrepayId();
        request.packageValue = wxOrder.getPackageValue();
        request.nonceStr= wxOrder.getNonceStr();
        request.timeStamp= wxOrder.getTimestamp();
        request.sign= wxOrder.getSign();
       boolean isOk= iwxapi.sendReq(request);
        XLog.d(isOk);
    }

    @Override
    public void unionpay() {

    }
}
